bitkeeper revision 1.1691.1.4 (42a6af07Q4gVBgwNowk1mRBYhuAX_A)
authorarun.sharma@intel.com[kaf24] <arun.sharma@intel.com[kaf24]>
Wed, 8 Jun 2005 08:40:39 +0000 (08:40 +0000)
committerarun.sharma@intel.com[kaf24] <arun.sharma@intel.com[kaf24]>
Wed, 8 Jun 2005 08:40:39 +0000 (08:40 +0000)
[PATCH] vmx-io-events.patch

- Handle the case where the VMX domains get events from ports other than
  IOPACKET_PORT (because of paravirtualized drivers)

- Use clear_bit() to operate on evtchn_upcall_pending

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
xen/arch/x86/vmx_io.c

index 95fa95aec88a6a790904859710d2e70967817238..240a3272231b419538c26105571241d9fed9eab9 100644 (file)
@@ -283,7 +283,7 @@ int vmx_clear_pending_io_event(struct vcpu *v)
 
     /* Note: VMX domains may need upcalls as well */
     if (!v->vcpu_info->evtchn_pending_sel) 
-        v->vcpu_info->evtchn_upcall_pending = 0;
+        clear_bit(0, &v->vcpu_info->evtchn_upcall_pending);
 
     /* clear the pending bit for IOPACKET_PORT */
     return test_and_clear_bit(IOPACKET_PORT, 
@@ -311,10 +311,16 @@ void vmx_wait_io()
     extern void do_block();
 
     do {
-        do_block();
+        if(!test_bit(IOPACKET_PORT, 
+            &current->domain->shared_info->evtchn_pending[0]))
+            do_block();
         vmx_check_events(current);
         if (!test_bit(ARCH_VMX_IO_WAIT, &current->arch.arch_vmx.flags))
             break;
+        /* Events other than IOPACKET_PORT might have woken us up. In that
+           case, safely go back to sleep. */
+        clear_bit(IOPACKET_PORT>>5, &current->vcpu_info->evtchn_pending_sel);
+        clear_bit(0, &current->vcpu_info->evtchn_upcall_pending);
     } while(1);
 }